//品牌管理相关接口
import request from '@/utils/request'
import type { HasTrademarkResponseData, Trademark } from './type'

//获取已有品牌列表接口
export const reqHasTrademarkAPI = (page: number, limit: number) =>
  request.get<any, HasTrademarkResponseData>(
    `/admin/product/baseTrademark/${page}/${limit}`
  )
//添加修改品牌接口合并判断
export const reqAddorUpdataTrademarkAPI = (data: Trademark) =>{
  if(data.id){
    return request.put<any, any>('/admin/product/baseTrademark/update', data)
  }else{
    return request.post<any, any>('/admin/product/baseTrademark/save', data)
  }
}
//删除品牌接口
export const reqDeleteTrademarkAPI = (id: number) =>
  request.delete<any, any>(`/admin/product/baseTrademark/remove/${id}`)
